The invention relates generally to video graphics processing and more particularly to a method and apparatus for video graphics anti-aliasing that utilizes a limited Z value sampling.
Computers are used in many applications. As computing systems continue to evolve, the graphical display requirements of the systems become more demanding. This is especially true in the area of three-dimensional (3D) graphics processing. In order to process 3D graphics images, the position of graphics primitives with respect to the display must be understood in all three dimensions. This includes the dimension of depth, often referred to as the Z dimension. The Z dimension describes the positioning of a video graphics primitive with respect to other video graphics primitives within the display frame in terms of the depth, or distance from the viewer, of the graphics primitives.
Computer displays and other high-resolution display devices such as high-definition televisions (HDTVs), projectors, printers, plotters, and the like, present an image to the viewer as an array of individual picture elements, or pixels. The individual pixels are each given a specific color, which corresponds to the color of the image at the location of the particular pixel. The pixels are closely spaced, and the viewer""s visual system performs a filtering of the individual pixel colors to form a composite image. If the partitioning of the image into individual pixel elements is performed properly, and the pixels are close enough together, the viewer perceives the displayed array of pixels as a virtually continuous image. Despite the viewer""s visual filtering, the viewer remains sensitive to aberrations in the image, and video graphics systems must be designed to minimize these aberrations.
In many systems, graphics images for display are sampled and the image is regenerated based on the stored samples. When the conservation of detail is important, oversampling is typically utilized to avoid aliasing in the reconstructed graphical image. Oversampling techniques are well known in the art. In an oversampling system, multiple samples of each screen element, or pixel, are stored. Although each pixel is rendered using only a single color value, each of the samples for that particular pixel are used in generating the final color. In effect, a much more detailed, higher resolution version of the image is stored within the computer and this version is used to generate each of the colors for the pixels displayed on the screen.
In an oversampling system that generates eight samples per pixel, each sample within the pixel consists of a color value and a Z value. The color value determines the color of the particular sample within the pixel, whereas the Z value determines the depth coordinate of the sample. As video graphics primitives are received that need to be merged with the pixel information already present for a particular display frame, the primitives are used to generate a number of pixel fragments. A pixel fragment corresponds to a particular pixel within the display frame which is identified by a set of X and Y coordinates. The fragments are typically oversampled in the same manner as pixels stored in the frame buffer. Each sample of the fragment consists of a color value and a Z value. Each of the color and Z values must be merged with the pixel information already stored for the particular display frame in order to generate a blended pixel that includes information already stored for the pixel and that received corresponding to the graphics primitive that produce the fragment.
Performing the computations required to merge a fragment having a number of different Z values corresponding to each of its samples with a pixel that also may include a number of different Z values can be very computationally complex. The bandwidth and other resources necessary to perform such calculations can reduce display processing speed and efficiency. One prior art solution that reduces the complexity of the calculations required to merge fragments is to store a single Z value corresponding to the center of the fragment for the entire fragment. This Z value is then used as an approximation to the Z value for all samples in the fragment in the merging operations.
However, problems can arise when the Z value at the center point of the pixel is used. This is especially true when two fragments intersect within a pixel, where one fragment only extends partially into the pixel, whereas the other fragment completely covers the pixel and has a Z value that should cause the complete coverage fragment to completely cover, from a viewer""s perspective, the partial fragment. If the fragment with partial coverage is extrapolated in the Z plane to extend to the middle of the pixel, the center pixel Z value for this partial fragment may effectively xe2x80x9cpoke throughxe2x80x9d the other fragment. When this xe2x80x9cpoke throughxe2x80x9d problem occurs, some color contribution from the partial fragment, which should not be visible, will be contributed to the final coloration of the pixel. This results in undesirable visual artifacts. The xe2x80x9cpoke throughxe2x80x9d artifact is described in more detail with reference to FIG. 1 below.
Therefore, a need exists for an anti-aliasing technique that is able to use a single Z value for an entire pixel fragment and yet avoid the visual artifacts induced by xe2x80x9cpoke throughxe2x80x9d and other problems that result from using the Z value at the center point of a pixel fragment.